TextShape AddHatchPatternOffsetInOut
Adds an Offset In Out filling type pattern to the shape
public void AddHatchPatternOffsetInOut(float insideOffsetGap, int insideOffsetCount, float outsideOffsetGap, int outsideOffsetCount, HatchOffsetAlgorithm algorithm, HatchCornerStyle cornerStyle) |
public void AddHatchPatternOffsetInOut(float insideOffsetGap, int insideOffsetCount, float outsideOffsetGap, int outsideOffsetCount, HatchOffsetAlgorithm algorithm, HatchCornerStyle cornerStyle, bool applySmoothing) |
Return value
void |
Parameters
float | insideOffsetGap | The gap between the offset lines inside the object boundary |
float | outsideOffsetGap | The gap between offset lines outside the object boundary |
int | insideOffsetCount | The number of offsets to be filled inside the object boundary |
int | outsideOffsetCount | The number of offsets to be filled outside of the object boundary |
HatchOffsetAlgorithm | algorithm | Select the hatching algorithm |
HatchCornerStyle | cornerStyle | Select the corner style |
bool | applySmoothing | Enable smoothing for hatch lines |
Example
Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);
if (scanDocument != null)
{
VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);
vectorImage.SetMarkSpeed(1000);
vectorImage.SetJumpSpeed(2000);
vectorImage.SetJumpDelay(100);
vectorImage.SetMarkDelay(100);
//Set Laser Delays
vectorImage.SetLaserOnDelay(10);
vectorImage.SetLaserOffDelay(10);
CircleShape circleShape1 = new CircleShape();
circleShape1.CenterPoint.X = 0.0f;
circleShape1.CenterPoint.Y = 0.0f;
circleShape1.CenterPoint.Z = 0.0f;
circleShape1.Radius = 5;
vectorImage.AddCircle(circleShape1);
CircleShape circleShape2 = new CircleShape();
circleShape2.CenterPoint.X = 2.5f;
circleShape2.CenterPoint.Y = 2.5f;
circleShape2.CenterPoint.Z = 0.0f;
circleShape2.Radius = 5;
vectorImage.AddCircle(circleShape2);
HatchShape hatchShape = new HatchShape();
hatchShape.AddCircle(0, 0, 0, 5, 1f);
hatchShape.AddCircle(2.5f, 2.5f, 0, 5, 0.5f);
hatchShape.AddHatchPatternOffsetInOut(0.2f, 5, 0.2f, 5, HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.Sharp);
vectorImage.AddHatch(hatchShape,0);
scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));
try
{
scanDocument.StartScanning();
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}